from django.db import models

# Create your models here.

class Banco(models.Model):
    numero = models.CharField(max_length=3)
    nombre = models.CharField(max_length=50)
    alias = models.CharField(max_length=50)

    def __unicode__(self):
	return self.alias

class Sucursal(models.Model):
    numero = models.CharField(max_length=3)
    banco = models.ForeignKey(Banco)
    nombre = models.CharField(max_length=50)
    alias = models.CharField(max_length=50)
    codigo_postal = models.CharField(max_length=4)
    
    class Meta:
	unique_together = (("numero","banco"),)

    def __unicode__(self):
	return self.nombre
